﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
//using System.Windows.Forms;

namespace HOOMT
{
    class HighOrderObjectDiagram : ObjectDiagram
    {
        private List<OriginalDiagram> diagramList = new List<OriginalDiagram>();
        private bool hasModelForm = false;
        private ObjectModelForm newModelForm = null;
        public string newModelFormId=null;
        
        
        //####################################################################################
        public HighOrderObjectDiagram(Point point, int width = 120, int height = 140)
            : base(point, width, height)
        {
            name = "HighObjectDiagram";
        }
        //绘图函数
        //************************************************************************************
        public override void Drawing(Graphics g, OriginalModelForm m)
        {
            Pen pen = new Pen(Color.Brown, 1);
            Rectangle rect = new Rectangle(upLeftpoint.X, upLeftpoint.Y, 2 * width / 3, height);
            Rectangle rect1 = new Rectangle(upLeftpoint.X + 2 * width / 3, upLeftpoint.Y + height / 7, width / 3, height / 7);
            Rectangle rect2 = new Rectangle(upLeftpoint.X + 2 * width / 3, upLeftpoint.Y + 3 * height / 7, width / 3, height / 7);
            Rectangle rect3 = new Rectangle(upLeftpoint.X + 2 * width / 3, upLeftpoint.Y + 5 * height / 7, width / 3, height / 7);
            g.DrawRectangle(pen, rect);
            g.DrawRectangle(pen, rect1);
            g.DrawRectangle(pen, rect2);
            g.DrawRectangle(pen, rect3);
            //显示文字
            /*nameBox.Size = new Size(width, 30);
            nameBox.Location = new Point(upLeftpoint.X, upLeftpoint.Y - 15);
            nameBox.Text = name;
            nameBox.BackColor = SystemColors.Control;//设置为与MainForm相同的颜色
            nameBox.BorderStyle = System.Windows.Forms.BorderStyle.None;//取消边框
            m.Controls.Add(nameBox);*/
            base.Drawing(g, m);
        }
        //************************************************************************************
        public List<OriginalDiagram> DiagramList
        {
            get
            {
                return diagramList;
            }
        }
        public bool HasModelForm
        {
            get
            {
                return hasModelForm;
            }
            set
            {
                hasModelForm = value;
            }
        }
        public ObjectModelForm NewModelForm
        {
            get
            {
                return newModelForm;
            }
            set
            {
                newModelForm = value;
            }
        }
        //************************************************************************************
        //TextBox textBox = new TextBox();
        /*public override List<Attribute> GetAttributes()
        {
            return this.attributeList;
        }
        public override List<Method> GetMethods()
        {
            return this.methodList;
        }*/
    }
}
